import Book.BookList;
import User.User;
import User.Admin;
import User.Animal;
import operation.IOperation;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: wenxiwen
 * Date: 2022/4/15
 * Time: 17:28
 * Description: No Description
 */
public class Main {
    public static Animal Logi() {
        System.out.println("请输出姓名:>");
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        System.out.println("请选择登录的方式 1. 普通用户   2. 管理员");
        int input = scan.nextInt();
        if(input == 1) {
            return new User(str);
        } else {
            return new Admin(str);
        }
    }
    public static void main(String[] args) {
        Animal animal = Logi();
        BookList booklist = new BookList();
        while(true) {
            int input = animal.menu();//通过返回类型来确认是哪个用户的对象 从而发生多态调用菜单
            animal.Usertion(input,booklist);
        }
    }
}
